<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Records</title>
<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
</head>
<body>
<div id="header">
	<div id="logo">
		<h1>Bridge Viz</h1>
	</div>
	<!-- end #logo -->
	<div id="menu">
		<ul>
			<li><a href="project.jsp">The Project</a></li>
			<li><a href="sensors.jsp">Sensor Info</a></li>
			<li><a href="visualization.jsp">Data Visualization</a></li>
			<li class="active"><a href="#">Records</a></li>
			<li><a href="#">Administration</a></li>
		</ul>
	</div>
	<!-- end #menu -->
</div>
<!-- end #header -->
<%@page import="bridge.*"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.text.DecimalFormat"%>

<% 
	Sensor[] sensors = null;
	DatabaseAccessor dba = DatabaseAccessor.getInstance();
	sensors = dba.getSensors();
%>
<div id="page">
	<div>
		<div class="post">
			<h2 class="title">Raw Data Retrieval </h2>
			<div class="entry">
				<p>This page allows for the retrieval of raw sensor data in CSV form.  The data downloaded can then easily be imported
				into your favorite spreadsheet or database program.</p>
				<form action="csv.jsp" method="get">
					<strong>Sensor ID:</strong>
					<br>
					<select name="sensorid">
						<%for(int k = 0; k < sensors.length; k++)
						{%>
						<option value="<%=sensors[k].sensorID%>"><%=sensors[k].type.type + " " + sensors[k].sensorID%></option>
						<%}%>
					</select>
					<br>
					<br>
					<strong>Start Date:</strong>
					<br>
					Time:<input maxlength="4" size="4" type="text" name="starttime" value="0000">
					Day:<input maxlength="2" size="2" type="text" name="startday" value="01">
					Month:<select name="startmonth">
						<option value="1">January</option>
						<option value="2">February</option>
						<option value="3">March</option>
						<option value="4">April</option>
						<option value="5">May</option>
						<option value="6">June</option>
						<option value="7">July</option>
						<option value="8">August</option>
						<option value="9">September</option>
						<option value="10">October</option>
						<option value="11">November</option>
						<option value="12">December</option>
					</select>
					Year:<input maxlength="4" size="4" type="text" name="startyear" value="1970">
					<br>
					<br>
					<strong>End Date:</strong>
					<br>
					Time:<input maxlength="4" size="4" type="text" name="endtime" value="0000">
					Day:<input maxlength="2" size="2" type="text" name="endday" value="05">
					Month:<select name="endmonth">
						<option value="1">January</option>
						<option value="2">February</option>
						<option value="3">March</option>
						<option value="4">April</option>
						<option value="5">May</option>
						<option value="6">June</option>
						<option value="7">July</option>
						<option value="8">August</option>
						<option value="9">September</option>
						<option value="10">October</option>
						<option value="11">November</option>
						<option value="12">December</option>
					</select>
					Year:<input maxlength="4" size="4" type="text" name="endyear" value="2009">
					<br>
					<br>
					<div style="text-align:center; padding:10px;"><input type="submit" value="Get CSV"></div>
					
				</form>
				
				
			</div>
		</div>
	</div>
</div>
<!-- end #page -->
<div id="footer">
	<p>&copy; 2008. All Rights Reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>
<!-- end #footer -->
</body>
</html>
